package com.service;

import com.dao.UserLoginDao;
import com.dao.UserLoginDaoImpl;
import com.exception.UserNotFoundException;

import vo.User;

public class UserLoginServiceImpl implements UserLoginService {
/*
 * 用户登录业务
 * */
	@Override
	public User userLogin(String username, String password) {
		UserLoginDao dao=new UserLoginDaoImpl();
		User user=dao.selectUserByUsernameAndPassword(username, password);
		if(user==null) {
			throw new UserNotFoundException("用户名或密码有误！");
		}
		
		return user;
	}

}
